From a8e2fc30823239e26f08cc5303899c56ca351296 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 18 Jan 2002 01:18:05 +0000 Subject: [PATCH] Fix missing allocation.x/y offsets. (#68962, Jacob Berkman) Thu Jan 17 20:13:14 2002 Owen Taylor * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix missing allocation.x/y offsets. (#68962, Jacob Berkman) * gtk/gtknotebook.c (gtk_notebook_size_allocate): Queue a redraw on the entire widget if we hide the last page or show the first. (Also #68962) --- ChangeLog | 10 ++++++++++ ChangeLog.pre-2-0 | 10 ++++++++++ ChangeLog.pre-2-10 | 10 ++++++++++ ChangeLog.pre-2-2 | 10 ++++++++++ ChangeLog.pre-2-4 | 10 ++++++++++ ChangeLog.pre-2-6 | 10 ++++++++++ ChangeLog.pre-2-8 | 10 ++++++++++ gtk/gtknotebook.c | 16 +++++++++++++++- 8 files changed, 85 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0cda76c973..3c36169aa5 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,13 @@ +Thu Jan 17 20:13:14 2002 Owen Taylor + + * gtk/gtknotebook.c (gtk_notebook_redraw_tabs): Fix + missing allocation.x/y offsets. (#68962, Jacob + Berkman) + + * gtk/gtknotebook.c (gtk_notebook_size_allocate): + Queue a redraw on the entire widget if we hide + the last page or show the first. (Also #68962) + 2002-01-17 Havoc Pennington * gtk/gtktextview.c (gtk_text_view_move_cursor_internal): change diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 438adf8cf2..d1f725d293 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -1158,6 +1158,7 @@ gtk_notebook_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { GtkNotebook *notebook = GTK_NOTEBOOK (widget); + gint vis_pages = 0; widget->allocation = *allocation; if (GTK_WIDGET_REALIZED (widget)) @@ -1220,11 +1221,21 @@ gtk_notebook_size_allocate (GtkWidget *widget, children = children->next; if (GTK_WIDGET_VISIBLE (page->child)) - gtk_widget_size_allocate (page->child, &child_allocation); + { + gtk_widget_size_allocate (page->child, &child_allocation); + vis_pages++; + } } gtk_notebook_pages_allocate (notebook); } + + if ((vis_pages != 0) != notebook->have_visible_child) + { + notebook->have_visible_child = (vis_pages != 0); + if (notebook->show_tabs) + gtk_widget_queue_draw (widget); + } } static gint @@ -2119,6 +2130,9 @@ gtk_notebook_redraw_tabs (GtkNotebook *notebook) break; } + redraw_rect.x += widget->allocation.x; + redraw_rect.y += widget->allocation.y; + gdk_window_invalidate_rect (widget->window, &redraw_rect, TRUE); } -- 2.30.2